package br.com.emmis.tercons.model;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import br.com.emmis.tercons.model.interfaces.Misterios;
import br.com.emmis.tercons.model.interfaces.Pray;

/**
 * Created by vaner on 03/10/2014.
 */
public class TercoModel {

    private List<Pray> mListOfPrays;
    private int mDayOfWeek;
    private int mMisterios;

    public TercoModel() {
        mListOfPrays = new ArrayList<Pray>();
        mDayOfWeek = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);

        Misterios misterios = null;
        if(mDayOfWeek == Calendar.MONDAY ||mDayOfWeek == Calendar.THURSDAY ){
            misterios = new MisteriosGozosos();
        } else if(mDayOfWeek == Calendar.TUESDAY ||mDayOfWeek == Calendar.FRIDAY ){
            misterios = new MisteriosDolorosos();
        } else {
            misterios = new MisteriosGloriosos();
        }

        List<Pray> listOfMisterios = null;
        List<Pray> listOfMisteriosDesc = null;
        if(misterios != null) {
            listOfMisterios = misterios.getListOfPray();
            listOfMisteriosDesc = misterios.getListOfPrayDesc();
            mMisterios = misterios.tituloId();
        }

        mListOfPrays.add(new SinalDaCruz());
        mListOfPrays.add(new Oferecimento());
        mListOfPrays.add(new Creio());
        mListOfPrays.add(new PaiNosso());
        mListOfPrays.add(new AveMaria(1));
        mListOfPrays.add(new AveMaria(2));
        mListOfPrays.add(new AveMaria(3));
        mListOfPrays.add(new Gloria());

        for (int i = 0; i < 5; i++) {
            mListOfPrays.add(listOfMisterios.get(i));
            mListOfPrays.add(listOfMisteriosDesc.get(i));

            mListOfPrays.add(new PaiNosso());
            for(int j = 0; j<10; j++) {
                mListOfPrays.add(new AveMaria(j+1));
            }
            mListOfPrays.add(new Gloria());
            mListOfPrays.add(new Jaculatorio());
        }

        mListOfPrays.add(new Agradecimento());
        mListOfPrays.add(new SalveRainha());
    }

    public int getMisteriosStringId() {
        return mMisterios;
    }

    public List<Pray> getListOfPrays() {
        return mListOfPrays;
    }
}
